package com.buanalintas.sandals.pos.entities;

import com.buanalintas.bynga.entities.MasterUnit;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name = "pos_master_employee")
//@NamedQueries({
//    @NamedQuery(name = "PosMasterEmployee.findAll", query = "SELECT t FROM PosMasterEmployee t"),
//    @NamedQuery(name = "PosMasterEmployee.findBySync", query = "SELECT t FROM PosMasterEmployee t WHERE t.sync = :sync"),
//    @NamedQuery(name = "PosMasterEmployee.findByEmployeeId", query = "SELECT t FROM PosMasterEmployee t WHERE t.employeeId = :employeeId"),
//    @NamedQuery(name = "PosMasterEmployee.findByEmployeeNik", query = "SELECT t FROM PosMasterEmployee t WHERE t.employeeNik = :employeeNik"),
//    @NamedQuery(name = "PosMasterEmployee.findByEmployeeName", query = "SELECT t FROM PosMasterEmployee t WHERE t.employeeName = :employeeName"),
//    @NamedQuery(name = "PosMasterEmployee.findByEmployeePlaceOfBirth", query = "SELECT t FROM PosMasterEmployee t WHERE t.employeePlaceOfBirth = :employeePlaceOfBirth"),
//    @NamedQuery(name = "PosMasterEmployee.findByEmployeeDateOfBirth", query = "SELECT t FROM PosMasterEmployee t WHERE t.employeeDateOfBirth = :employeeDateOfBirth"),
//    @NamedQuery(name = "PosMasterEmployee.findByEmployeeAddress", query = "SELECT t FROM PosMasterEmployee t WHERE t.employeeAddress = :employeeAddress"),
//    @NamedQuery(name = "PosMasterEmployee.findByEmployeePhone", query = "SELECT t FROM PosMasterEmployee t WHERE t.employeePhone = :employeePhone"),
//    @NamedQuery(name = "PosMasterEmployee.findByEmployeeEmail", query = "SELECT t FROM PosMasterEmployee t WHERE t.employeeEmail = :employeeEmail")})
public class PosMasterEmployee implements Serializable {

    private static final long serialVersionUID = 1L;
    @Column(name = "sync")
    private String sync;
    @Id
    @Basic(optional = false)
    @Column(name = "employee_id")
    private Integer employeeId;
    @Column(name = "employee_nik")
    private String employeeNik;
    @Column(name = "employee_name")
    private String employeeName;
    @Column(name = "employee_place_of_birth")
    private String employeePlaceOfBirth;
    @Column(name = "employee_date_of_birth")
    @Temporal(TemporalType.DATE)
    private Date employeeDateOfBirth;
    @Column(name = "employee_address")
    private String employeeAddress;
    @Column(name = "employee_phone")
    private String employeePhone;
    @Column(name = "employee_email")
    private String employeeEmail;
    @JoinColumn(name = "employee_unit_id", referencedColumnName = "unit_id")
    @ManyToOne
    private MasterUnit employeeUnitId;
    @JoinColumn(name = "employee_shop_id", referencedColumnName = "shop_id")
    @ManyToOne
    private PosMasterShop employeeShopId;
    @JoinColumn(name = "employee_position_id", referencedColumnName = "position_id")
    @ManyToOne
    private PosMasterPosition employeePositionId;

    public PosMasterEmployee() {
    }

    public PosMasterEmployee(Integer employeeId) {
        this.employeeId = employeeId;
    }

    public String getSync() {
        return sync;
    }

    public void setSync(String sync) {
        this.sync = sync;
    }

    public Integer getEmployeeId() {
        return employeeId;
    }

    public void setEmployeeId(Integer employeeId) {
        this.employeeId = employeeId;
    }

    public String getEmployeeNik() {
        return employeeNik;
    }

    public void setEmployeeNik(String employeeNik) {
        this.employeeNik = employeeNik;
    }

    public PosMasterShop getEmployeeShopId() {
        return employeeShopId;
    }

    public void setEmployeeShopId(PosMasterShop employeeShopId) {
        this.employeeShopId = employeeShopId;
    }

    public MasterUnit getEmployeeUnitId() {
        return employeeUnitId;
    }

    public void setEmployeeUnitId(MasterUnit employeeUnitId) {
        this.employeeUnitId = employeeUnitId;
    }

    public PosMasterPosition getEmployeePositionId() {
        return employeePositionId;
    }

    public void setEmployeePositionId(PosMasterPosition employeePositionId) {
        this.employeePositionId = employeePositionId;
    }

    public String getEmployeeName() {
        return employeeName;
    }

    public void setEmployeeName(String employeeName) {
        this.employeeName = employeeName;
    }

    public String getEmployeePlaceOfBirth() {
        return employeePlaceOfBirth;
    }

    public void setEmployeePlaceOfBirth(String employeePlaceOfBirth) {
        this.employeePlaceOfBirth = employeePlaceOfBirth;
    }

    public Date getEmployeeDateOfBirth() {
        return employeeDateOfBirth;
    }

    public void setEmployeeDateOfBirth(Date employeeDateOfBirth) {
        this.employeeDateOfBirth = employeeDateOfBirth;
    }

    public String getEmployeeAddress() {
        return employeeAddress;
    }

    public void setEmployeeAddress(String employeeAddress) {
        this.employeeAddress = employeeAddress;
    }

    public String getEmployeePhone() {
        return employeePhone;
    }

    public void setEmployeePhone(String employeePhone) {
        this.employeePhone = employeePhone;
    }

    public String getEmployeeEmail() {
        return employeeEmail;
    }

    public void setEmployeeEmail(String employeeEmail) {
        this.employeeEmail = employeeEmail;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (employeeId != null ? employeeId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        if (!(object instanceof PosMasterEmployee)) {
            return false;
        }
        PosMasterEmployee other = (PosMasterEmployee) object;
        if ((this.employeeId == null && other.employeeId != null) || (this.employeeId != null && !this.employeeId.equals(other.employeeId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return employeeName;
        //return "com.buanalintas.sandals.pos.entities.PosMasterEmployee[employeeId=" + employeeId + "]";
    }
}
